package com.wtwd.campus.constant;

/**
 * @author mjy
 * @date 2022/12/13
 * @description
 */
public enum UploadAppFileTypeEnum {

    APP_IMAGE(1, 60*24*7, "app展示图片");


    /**
     * 图片类型
     */
    private int type;

    /**
     * 缓存时间单位分钟
     */
    private int cacheTime;

    /**
     * 描述
     */
    private String msg;


    UploadAppFileTypeEnum(int type, int cacheTime, String msg) {
        this.type = type;
        this.cacheTime = cacheTime;
        this.msg = msg;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getCacheTime() {
        return cacheTime;
    }

    public void setCacheTime(int cacheTime) {
        this.cacheTime = cacheTime;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public String toString() {
        return "UploadAppFileTypeEnum{" +
                "type=" + type +
                ", cacheTime=" + cacheTime +
                ", msg='" + msg + '\'' +
                '}';
    }

    public static UploadAppFileTypeEnum getUploadAppFileTypeEnumByType(int type) {
        for (UploadAppFileTypeEnum value : UploadAppFileTypeEnum.values()) {
            if (value.getType()==(type)) {
                return value;
            }
        }
        return null;
    }
}
